var exec = require('cordova/exec');

module.exports = {
    checkBluetooth: function (success, error) {
        exec(success, error, "BluetoothPlugin", "checkBluetooth", []);
    },
    openBluetooth: function (success, error) {
        exec(success, error, "BluetoothPlugin", "openBluetooth", []);
    },
    searchDevices: function (success, error) {
        exec(success, error, "BluetoothPlugin", "searchDevices", []);
    },
    stopSearchDevices: function (success, error) {
        exec(success, error, "BluetoothPlugin", "stopSearchDevices", []);
    },
    saveDevice: function (success, error, device) {
        exec(success, error, "BluetoothPlugin", "saveDevice", [device]);
    },
    saveDevices: function (success, error, devices) {
        exec(success, error, "BluetoothPlugin", "saveDevices", [devices]);
    },
    getSavedDevice: function (success, error) {
        exec(success, error, "BluetoothPlugin", "getSavedDevice",[]);
    },
    getSavedDevices: function (success, error) {
        exec(success, error, "BluetoothPlugin", "getSavedDevices",[]);
    },
    getData: function (success, error,address) {
        exec(success, error, "BluetoothPlugin", "getData",[address]);
    },
    sendData: function (success, error, data) {
        exec(success, error, "BluetoothPlugin", "sendData", [data]);
    },
    connectDevice: function(success, error, address) {
        exec(success, error, "BluetoothPlugin", "connectDevice", [address]);
    }
}